package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;

@Entity
public class Ctschemesrecord {
    private int ctrId;
    private BigDecimal ctrAmount;
    private Date ctrData;
    private String ctrCurrencytype;
    private Integer ctrInvoice;
    private Integer ctrUserid;
    private Ctschemes ctschemesByCtId;

    @Id
    @Column(name = "ctr_id")
    public int getCtrId() {
        return ctrId;
    }

    public void setCtrId(int ctrId) {
        this.ctrId = ctrId;
    }

    @Basic
    @Column(name = "ctr_amount")
    public BigDecimal getCtrAmount() {
        return ctrAmount;
    }

    public void setCtrAmount(BigDecimal ctrAmount) {
        this.ctrAmount = ctrAmount;
    }

    @Basic
    @Column(name = "ctr_data")
    public Date getCtrData() {
        return ctrData;
    }

    public void setCtrData(Date ctrData) {
        this.ctrData = ctrData;
    }

    @Basic
    @Column(name = "ctr_currencytype")
    public String getCtrCurrencytype() {
        return ctrCurrencytype;
    }

    public void setCtrCurrencytype(String ctrCurrencytype) {
        this.ctrCurrencytype = ctrCurrencytype;
    }

    @Basic
    @Column(name = "ctr_invoice")
    public Integer getCtrInvoice() {
        return ctrInvoice;
    }

    public void setCtrInvoice(Integer ctrInvoice) {
        this.ctrInvoice = ctrInvoice;
    }

    @Basic
    @Column(name = "ctr_userid")
    public Integer getCtrUserid() {
        return ctrUserid;
    }

    public void setCtrUserid(Integer ctrUserid) {
        this.ctrUserid = ctrUserid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Ctschemesrecord that = (Ctschemesrecord) o;
        return ctrId == that.ctrId &&
                Objects.equals(ctrAmount, that.ctrAmount) &&
                Objects.equals(ctrData, that.ctrData) &&
                Objects.equals(ctrCurrencytype, that.ctrCurrencytype) &&
                Objects.equals(ctrInvoice, that.ctrInvoice) &&
                Objects.equals(ctrUserid, that.ctrUserid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ctrId, ctrAmount, ctrData, ctrCurrencytype, ctrInvoice, ctrUserid);
    }

    @ManyToOne
    @JoinColumn(name = "ct_id", referencedColumnName = "ct_id")
    public Ctschemes getCtschemesByCtId() {
        return ctschemesByCtId;
    }

    public void setCtschemesByCtId(Ctschemes ctschemesByCtId) {
        this.ctschemesByCtId = ctschemesByCtId;
    }
}
